package com.serverapk.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import com.serverapk.util.L;
import com.serverapk.util.NetworkUtil;

/**
 * Created by 葛健 on 2020/10/11.
 */

public class NetStateBroadReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        int netWorkStates = NetworkUtil.getNetWorkStates(context);
        switch (netWorkStates) {
            case NetworkUtil.TYPE_NONE:

                break;
            case NetworkUtil.TYPE_MOBILE:
                L.e("移动网络====");
                break;
            case NetworkUtil.TYPE_WIFI:
                //打开了WIFI
                L.e("wifi网络====");
                break;
            default:
                break;
        }
    }
}

